// holds information for a particular piece of the grid
// which is being explored by A*

#ifndef NODE_H
#define NODE_H

#include "Utilities.h"

class Node
{
protected:
	// total cost to square and then dest
	int f;
	// cost to get to square
	int g;
	// heuristic to dest
	int h;
	// current node which leads most quickly to this one
	Node * parent;

	Position position;

public:

	Node();
	Node( Position pos, int _g = 0, int _h = 0, Node * par = 0 );
	Node( const Node & n );
	~Node();
	int F() const;
	int G() const;
	int H() const;
	void G( int g );
	void H( int h );
	Node * Parent() const;
	void Parent( Node * par );
	Position getPosition() const;
	void setPosition( Position pos );
	bool operator>( const Node & rh ) const;
	bool operator<( const Node & rh ) const;
};

#endif